package com.gtp.demo.api;

import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

@Component
public class TestConsumer {

	/**
	 * 能设置
	 * 1.消费组
	 * 2.topic
	 * 3.consumeMode 有序还是并发
	 * 4.consumeThread
	 * 5.consumeTimeout
	 * 6.nameServer
	 * 7.差从哪里消费设置?
	 */
    @Service
    @RocketMQMessageListener(topic = "test-topic-1", consumerGroup = "my-consumer_test-topic-1")
    public class MyConsumer1 implements RocketMQListener<String>{
        public void onMessage(String message) {
            //log.info("received message: {}", message);
        }
    }
    
    @Service
    @RocketMQMessageListener(topic = "test-topic-2", consumerGroup = "my-consumer_test-topic-2")
    public class MyConsumer2 implements RocketMQListener<String>{
        public void onMessage(String message) {
            //log.info("received orderPaidEvent: {}", orderPaidEvent);
        }
    }
}
